MOBILE-4901: Update @ngx-translate to version 17#4650
Merged
dpalou merged 7 commits intomoodlehq:mainfrom Jan 27, 2026
Merged
Conversation
604b288 to
ec52c86
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades the @ngx-translate library from version 16 to 17 and refactors the translation loading system to implement a custom MoodleTranslateLoader class.
Changes:
- Migrated from
TranslateModuletoTranslatePipeandprovideTranslateServicefollowing ngx-translate v17 standalone API patterns - Implemented custom
MoodleTranslateLoaderto centralize translation loading, parent language merging, and custom/site plugin string management - Refactored custom language strings and site plugin strings handling to use the new loader architecture
- Updated test utilities to reflect API changes (
onDefaultLangChange→onFallbackLangChange)
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/testing/utils.ts | Updated mock and imports for ngx-translate v17 API changes |
| src/main.ts | Replaced TranslateModule.forRoot() with provideTranslateService() and removed factory function |
| src/core/tests/behat/language.feature | Expanded language tests to include parent language and custom string scenarios |
| src/core/tests/behat/customlangstrings.feature | Removed file (tests merged into language.feature) |
| src/core/singletons/countries.ts | Added constant for translation key prefix and refactored to use new getMessages API |
| src/core/services/lang.ts | Major refactor to delegate translation management to MoodleTranslateLoader |
| src/core/features/siteplugins/services/siteplugins.ts | Updated type definition for parsed language strings |
| src/core/features/siteplugins/services/siteplugins-init.ts | Updated to use new addSitePluginsStrings API signature |
| src/core/features/mainmenu/pages/reload/reload.ts | Changed from ngOnInit to ionViewDidEnter lifecycle hook |
| src/core/classes/lang-loader.ts | New file implementing MoodleTranslateLoader class |
| src/core/base.module.ts | Replaced TranslateModule.forChild() with standalone TranslatePipe |
| package.json | Updated ngx-translate dependencies to v17 |
| cordova-plugin-moodleapp/package.json | Updated esbuild dependency |
Files not reviewed (1)
- cordova-plugin-moodleapp/package-lock.json: Language not supported
b832a5f to
b9afed5
Compare
b9afed5 to
df47499
Compare
ebeca30 to
5b92f79
Compare
dpalou
requested changes
Jan 26, 2026
5b92f79 to
fed39a4
Compare
fed39a4 to
8e1e525
Compare
8e1e525 to
b5dab17
Compare
b5dab17 to
2da6005
Compare
dpalou
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.